LOAD

Syntax: LOAD device_filename     
 or LOAD [device_]filename  (Toolkit II)
Location: QL ROM, Toolkit II

This command looks for a SuperBASIC program held on the given device under the specified filename (a program file), reporting the error 'not found' if either the device or the filename does not exist. If found, it then clears any current SuperBASIC program out of memory, closes all channels with a channel number greater than #2, turns off any WHEN processing, and performs a CLS on #0, #1 and #2. Each line of the program file is loaded into memory and then parsed as if it hao the command line by the user. If any lines cannot be parsed (ie. they would normally generate a 'bad line' error), then the word MISTake is inserted into the line after the line number and the loading process continues.

If the program file contains some lines in it which do not have line numbers, then these are automatically executed as if they had been typed direct into the keyboard.

If you have Toolkit II present, then if a device is not specified, or LOAD cannot find the specified file on the given device, then Toolkit II will add the default data device to the filename. If the file still cannot be found, then the default program device is used instead.

Example:
LOAD mdv1_Test1_bas
LOAD 'n'&station&'_flp1_'&file$
LOAD neti_3

SMS NOTES:
LOAD has been re-written so that it will also load files saved with the QLOAD utility from Liberation Software (which is now part of SMS).

If the specified filename does not end in _SAV or _BAS, then if the specified filename does not exist, before trying the default data device and the default program device (see above), LOAD will first of all try the filename with _BAS appended and if still not found, will try the filename with _SAV appended.

CROSS-REFERENCE:
SAVE saves the current SuperBASIC program in memory.
LRUN automatically runs the program after loading.
MERGE and MRUN are similar commands.  Also see QLOAD and RELOAD.
EXEC allows you to load a multitasking program (normally a machine code program or a compiled program).
LBYTES allows you to load a section of memory.
